package com.jsoft.test;

import com.jsoft.dao.EnterpriseDao;
import com.jsoft.dao.impl.EnterpriseDaoImpl;
import com.jsoft.entity.Enterprise;
import org.junit.Test;

import java.util.List;

/**
 * @author snkstart
 * @create 2023-02-20 20:17
 */
public class testEnterpriseDao {
    private EnterpriseDao enterpriseDao=new EnterpriseDaoImpl();
    @Test
    public void testselectEnterprise(){
        try {
            List<Enterprise> enterprises = enterpriseDao.selectEnterprise();
            for (Enterprise e : enterprises) {
                System.out.println(e);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    @Test
    public void testselectEnterpriseCodeByName(){
        try {
            String baiduCode = enterpriseDao.selectEnterpriseCodeByName("百度有限公司");
            System.out.println(baiduCode);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    @Test
    public void testfindEnterpriseById(){
        try {
            Enterprise enterpriseById = enterpriseDao.findEnterpriseById(1);
            System.out.println(enterpriseById);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
